<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=utf-8" errorPage="/error.jsp" isELIgnored="false" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache" %>
<%@ taglib uri="http://atleap.blandware.com/taglib" prefix="atleap" %>
<html:xhtml />

<atleap:constants className="com.blandware.atleap.webapp.util.forum.ForumModuleWebConstants" var="FORUM_PARENTS_LIST_KEY" />
<atleap:constants className="com.blandware.atleap.webapp.util.forum.ForumModuleWebConstants" var="PARENT_TOPIC_KEY" />

<c:set var="parentsList" value="${sessionScope[pageScope.FORUM_PARENTS_LIST_KEY]}" />
<c:set var="parentTopic" value="${sessionScope[pageScope.PARENT_TOPIC_KEY]}" />
<c:if test="${parentsList != null}">
    <div class="forumPath">
        <strong><atleap:message key="forum.forum.form.path" /></strong>:
        <bean:size id="parentsNumber" collection="${parentsList}" />
        <atleap:message key="forum.forum.form.gotoRoot" var="linkTitle" />
        <c:if test="${parentsNumber > 0}">
            <atleap:message key="forum.forum.form.toRoot" var="titleMsg" />
            <atleap:link action="forum/forum/showForums" title="${linkTitle}">
                ${titleMsg}
            </atleap:link>
            &nbsp;&gt;&nbsp;
        </c:if>
        <atleap:message key="forum.forum.form.readForum" var="linkTitle" />
        <atleap:iterator items="${parentsList}" var="parentForum" statusVar="listStatus">
            <c:set var="titleMsg">
                <atleap:fieldValue valueMap="${parentForum.title}" complexSearch="true" filter="true" />
            </c:set>
            <atleap:link action="/forum/item${parentForum.id}" title="${linkTitle}">
                ${titleMsg}
            </atleap:link>
            <c:if test="${!listStatus.last}">
                &nbsp;&gt;&nbsp;
            </c:if>
        </atleap:iterator>
        <c:if test="${parentTopic != null}">
            <atleap:message key="forum.topic.form.readTopic" var="linkTitle" />
            <c:set var="titleMsg">
                <atleap:fieldValue valueMap="${parentTopic.firstPost.title}" complexSearch="true" filter="true" />
            </c:set>
            &nbsp;&gt;&nbsp;
            <atleap:link action="/forum/topic${parentTopic.id}" title="${linkTitle}">
                <em>${titleMsg}</em>
            </atleap:link>
        </c:if>
    </div>
</c:if>
